<?php

namespace Log;

class LogLevel {
	private $name;

	public function __construct ($name) {
		$this->name = $name;
	}

	public function __toString () {
		return $this->name;
	}
	
	private static $finest, $finer, $fine, $info, $warn, $critical, $fatal;

	public static function initialise () {
		self::$finest	= new LogLevel('finest'		);
		self::$finer	= new LogLevel('finer'		);
		self::$fine		= new LogLevel('fine'		);
		self::$info		= new LogLevel('info'		);
		self::$warn		= new LogLevel('warn'		);
		self::$critical	= new LogLevel('critical'	);
		self::$fatal	= new LogLevel('fatal'		);
	}

	public static function cleanup () {
		unset(self::$finest		);
		unset(self::$finer		);
		unset(self::$fine		);
		unset(self::$info		);
		unset(self::$warn		);
		unset(self::$critical	);
		unset(self::$fatal		);
	}

	public static function finest () {
		return self::$finest;
	}

	public static function finer () {
		return self::$finer;
	}

	public static function fine () {
		return self::$fine;
	}

	public static function info () {
		return self::$info;
	}

	public static function warn () {
		return self::$warn;
	}

	public static function critical () {
		return self::$critical;
	}

	public static function fatal () {
		return self::$fatal;
	}
}
